package cn.pn.project.mapper.order;

import cn.pn.project.pojo.order.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderDetailMapper {

    /**
     * 根据主键Id获取订单详情信息
     * @param childOrderId
     * @return
     * @throws Exception
     */
    public OrderDetail getOrderDetail(@Param(value = "childOrderId") Integer childOrderId)throws Exception;


    /**
     * 多条件查询订单详情信息（分页）
     * @param param
     * @return
     * @throws Exception
     */
    public List<OrderDetail> getOrderDetailListByMap(Map<String,Object> param)throws Exception;


    /**
     * 多条件查询订单详情数量
     * @param param
     * @return
     * @throws Exception
     */
    public Integer getOrderDetailCountByMap(Map<String,Object> param)throws Exception;

    /**
     * 新增订单详情信息
     * @param orderDetail
     * @return
     * @throws Exception
     */
    public Integer insertOrderDetail(OrderDetail orderDetail)throws Exception;

    /**
     * 修改订单详情信息
     * @param orderDetail
     * @return
     * @throws Exception
     */
    public Integer updateOrderDetail(OrderDetail orderDetail)throws Exception;

    /**
     * 删除订单详情信息根据Id
     * @param childOrderId
     * @return
     * @throws Exception
     */
    public Integer deleteOrderDetailById(@Param(value = "childOrderId") Integer childOrderId)throws Exception;


    /**
     * 删除订单详情信息根据orderNum
     * @param orderNum
     * @return
     * @throws Exception
     */
    public Integer deleteOrderDetailByOrderNum(@Param(value = "orderNum") String orderNum)throws Exception;

}
